package com.jkdz.spyke.flexUI.helpers {
	import flash.utils.getTimer;
	import flash.events.Event;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Shape;
	import flash.display.Sprite;
	
	public class ResizingCursor extends Sprite {
		
		private static const ALL:int = 15;
		private static const SIZE:int = 9;
		private static const FILL:int = 0xffdddddd;
		private static const STROKE:int = 0xff333333;
		
		public function ResizingCursor() {
			var ul:Shape = generatePart();
			var bd:BitmapData = new BitmapData(SIZE+1, SIZE+1, true, 0x00000000);
			var uls:Sprite = new Sprite();
			uls.addChild(ul);
			bd.draw(uls);
			uls = new Sprite();
			var ulb:Bitmap = new Bitmap(bd);
			ulb.smoothing = true;
			uls.addChild(ulb);
			bd = new BitmapData(ALL+1, ALL+1, true, 0x00000000);
			bd.draw(uls);
			ulb.x = ALL;
			ulb.y = ALL;
			ulb.rotation = 180;
			bd.draw(uls);
			ulb = new Bitmap(bd);
			ulb.smoothing = true;
			ulb.x = -ulb.width/2;
			ulb.y = -ulb.height/2;
			addChild(ulb);
		}
		
		private function generatePart():Shape {
			var part:Shape = new Shape();
			part.graphics.beginFill(FILL);
			part.graphics.lineStyle(1, STROKE);
			part.graphics.drawTriangles(Vector.<Number>([0, 0, SIZE, 0, 0, SIZE]));
			part.graphics.endFill();
			return part;
		}
	}
}
